// 与功能页签相关的动态效果
var imgLeft = new Image();
var imgRight = new Image();
var imgLeftSelect = new Image();
var imgRightSelect = new Image();
var imgLeftOver = new Image();
var imgRightOver = new Image();

imgLeft.src="images/menu_01.gif";
imgRight.src="images/menu_03.gif";
imgLeftSelect.src="images/afterselect_01.gif";
imgRightSelect.src="images/afterselect_03.gif";
imgLeftOver.src="images/menu_over1.gif";
imgRightOver.src="images/menu_over3.gif";

var oldObj = null;
var oldImg1 = null;
var oldImg2 = null;
var oldObj2 = null;

function tab_click(currImg1ID, currObj, currImg2ID, url,url2){
	if(url2 == undefined ){
		//弹出页面上点击tab
		parent.document.getElementById('main').src = url;
	}else{
		//主界面上点击tab
		parent.frames['main'].frames['left'].document.location = url;
		parent.frames['main'].frames['content'].document.location = url2;
	}
	currImg1 = document.getElementById(currImg1ID);
	currImg2 = document.getElementById(currImg2ID);
	if(oldObj != currObj){
		if(oldObj){
			oldObj.className='indexbgcommon';
			oldImg1.getElementsByTagName("img")[0].src=imgLeft.src;
			oldImg2.childNodes[0].src=imgRight.src;
		}
		currObj.className='indexbgcommon2';
		currImg1.childNodes[0].src=imgLeftSelect.src;
		currImg2.childNodes[0].src=imgRightSelect.src;
		oldObj = currObj;
		oldImg1 = currImg1;
		oldImg2 = currImg2;
	}
}

function tab_MouseOver(currImg1ID, currObj, currImg2ID){
  currImg1 = document.getElementById(currImg1ID);
  currImg2 = document.getElementById(currImg2ID);
  
  if(oldObj != currObj){
	currObj.className = "indexOver";
	
    currImg1.childNodes[0].src=imgLeftOver.src;
	currImg2.childNodes[0].src=imgRightOver.src;
  }
}

function tab_MouseOut(currImg1ID, currObj, currImg2ID){
  currImg1 = document.getElementById(currImg1ID);
  currImg2 = document.getElementById(currImg2ID);
  
  if(oldObj != currObj){
	currObj.className = "indexbgcommon";
	
    currImg1.childNodes[0].src=imgLeft.src;
	currImg2.childNodes[0].src=imgRight.src;
  }
}

function tab_load(){
  	oldObj = document.getElementById("TDX");
  	oldImg1 = document.getElementById("1");
  	oldImg2 = document.getElementById("2");
	oldObj.className='indexbgcommon2';
	oldImg1.childNodes[0].src=imgLeftSelect.src;
	oldImg2.childNodes[0].src=imgRightSelect.src;
}